#ifndef TCPSERVER_H
#define TCPSERVER_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/time.h>
#include <errno.h>
#include "UdpServer.h"

//QI
#define QT_IP "172.31.36.70"
#define QT_PORT 8888
#define MAX_CLIENTS 20

//STM
#define STM_IP "172.31.36.70"
#define STM_PORT 7777
#define MAX_CLIENTS 20

#endif


int createSocket(const char * ip, unsigned short port);
void mainLoop(int sockfd);
void handleData(int actfd);
void* sendThreadFunc(void* arg);

int createSocket_st(const char * ip, unsigned short port);
void mainLoop_st(int sockfd);
void handleData_st(int actfd);
void* startTcpStmServer(void *arg);